package bezier;

public class Point {
	private double x;
	private double y;
	
	public Point() {
		
	}

	public Point(double x, double y) {
		this.x = x;
		this.y = y;
	}
	
	public double getX() {
		return x;
	}

	public void setX(double x) {
		this.x = x;
	}

	public double getY() {
		return y;
	}

	public void setY(double y) {
		this.y = y;
	}
	
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("x: ");
		builder.append(x);
		builder.append(", ");
		builder.append("y: ");
		builder.append(y);
		return builder.toString();
	}
	
	public static Point multiplyByValue(Point point, double value) {
		Point p = new Point();
		p.setX(point.getX() * value);
		p.setY(point.getY() * value);
		return p;
	}
	
	public static Point add(Point a, Point b) {
		double x = a.getX() + b.getX();
		double y = a.getY() + b.getY();
		Point point = new Point(x, y);
		return point;
	}

}
